package com.example.observepattern.demo;

/**
 * @author liw
 * @date 2022-10-27
 */
public class CurrentCondition implements Observer {
    private float temperature;
    private float humidity;
    private float pressure;

    @Override
    public void update(float temperature, float pressure, float humidity) {
        this.temperature = temperature;
        this.humidity = humidity;
        this.pressure = pressure;
        display();
    }

    public void display(){
        System.out.println("current temperature: " + this.temperature);
        System.out.println("current pressure: " + this.pressure);
        System.out.println("current humidity: " + this.humidity);
    }
}
